 /*
day300 
2020.6.23 
*/
#include<iostream>
#include<vector>
using namespace std;

class Solution {
public:
    double findMaxAverage(vector<int>& nums, int k) {
    	double res=0,tem=0;
		for(int i=0;i<k;++i)
		{
			tem+=1.0*nums[i]/k;
		}
		res=tem;
		
		for(int i=1;i+k-1<nums.size();++i)
		{
			tem+=1.0*(nums[i+k-1]-nums[i-1])/k;
			if(tem>res)
			{
				res=tem;
			}
		}
		
		return res;
    }
};


int main()
{
	return 0;
 } 
